import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "Login",
    component: () => import("/@/views/login.vue"),
  },

  {
    path: "/:pathMatch(.*)*",
    name: "notFound",
    component: () => import("/@/views/error/404.vue"),
  },
  {
    path: "/home",
    name: "home",
    component: () => import("/@/views/Home.vue"),
    children: [
      {
        path: "/user",
        name: "user",
        component: () => import("/@/views/system/UserList/index.vue")
      }, {
        path: "/role",
        name: "role",
        component: () => import("/@/views/system/role.vue")
      }, {
        path: "/menus",
        name: "menus",
        component: () => import("/@/views/system/menus.vue")
      },
      // {
      //   path: "/chart",
      //   name: "chart",
      //   component: () => import("/@/views/data/chart.vue")
      // }, {
      //   path: "/map",
      //   name: "map",
      //   component: () => import("/@/views/data/map.vue")
      // }, {
      //   path: "/block",
      //   name: "block",
      //   component: () => import("/@/views/data/block.vue")
      // }
      {
        path: "/:pathMatch(.*)*",
        name: "notFound",
        component: () => import("/@/views/error/404.vue"),
      },
    ]
  },
];

export default createRouter({
  history: createWebHistory('/start-vue3/'),
  routes,
});
